package com.gl.user.service.impl;

import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.cloud.model.AppUser;
import com.gl.user.dao.AppUserDao;
import com.gl.user.service.AppUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Slf4j
@Service
public class AppUserServiceImpl  extends ServiceImpl<AppUserDao, AppUser> implements AppUserService {

    @Autowired
    private AppUserDao appUserDao;

    @Override
    public String findByUsername(String username) {
        return appUserDao.findTest(username);
    }

    @Override
    public Page<String> findUsersByPage(Page<String> appUserPage, Map<String, Object> params) {
        List<String> usersByPage = appUserDao.findUsersByPage(appUserPage, params);

        return appUserPage.setRecords(usersByPage);
    }
}
